<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{css/bootstrap.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{css/bootstrap.min.css}"/>
    <script type="text/javascript" th:src="@{js/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{js/bootstrap.js}"></script>
    <title>违法记录表</title>
    <script>


    </script>
</head>
<body>
<h1 align="center">车辆违法记录</h1>
<div>

    <form class="form-inline">
        <div class="form-group">
            <label for="exampleInputName2">车牌号</label>
            <input type="text" class="form-control" id="exampleInputName2" name="carName" placeholder="车牌号">
        </div>
        <div class="form-group">
            <label for="example1">违法开始时间</label>
            <input type="datetime-local" class="form-control" id="example1" name="start" placeholder="违法开始时间">
        </div>
        <div class="form-group">
            <label for="example2">违法结束时间</label>
            <input type="datetime-local" class="form-control" id="example2" name="end" placeholder="违法结束时间">
        </div>
        <button type="submit" class="btn btn-default">查询</button>
        <span style="padding-left:610px"><a  th:href="add" th:type="button" class="btn btn-danger">添加违法记录</a></span>
    </form>

</div>
<div>
    <table class="table table-hover">
        <tr>
            <td>序号</td>
            <td>违法时间</td>
            <td>车牌号</td>
            <td>车主姓名</td>
            <td>车主手机号</td>
            <td>违法代码</td>
            <td>违法行为</td>
            <td>违法地点</td>
            <td>罚款</td>
            <td>记分</td>
            <td>状态</td>
            <td>操作</td>
        </tr>
        <tr th:each="record:${pageInfo.getContent()}">
            <td th:text="${record.recordId}"></td>
            <td th:text="${record.itemDate}"></td>
            <td th:text="${record.user.carNum}"></td>
            <td th:text="${record.user.userName}"></td>
            <td th:text="${record.user.tel}"></td>
            <td th:text="${record.item.itemId}"></td>
            <td th:text="${record.item.delict}"></td>
            <td th:text="${record.address}"></td>
            <td th:text="${record.item.fine}"></td>
            <td th:text="${record.item.r_score}"></td>
            <td th:if="${record.status} == true">已处理</td>
            <td th:if="${record.status} == false">待处理</td>
            <td>
                <form>
                    <a th:href="add" th:type="button" class="btn btn-warning" th:disabled="${record.status} == true">编辑</a>
                </form>
                <form th:action="updateUser" method="get">
                    <input type="hidden" name="fine" th:value="${record.item.fine}">
                    <input type="hidden" name="score" th:value="${record.item.r_score}">
                    <input type="hidden" name="recordId" th:value="${record.recordId}">
                    <button type="submit" class="btn bg-danger" th:disabled="${record.status} == true">处理</button>
                </form>
            </td>
        </tr>
    </table>
</div>
<div align="center">
    <nav aria-label="Page navigation">
        <ul class="pagination pagination-lg">

            <li>
                <a th:href="@{showRecord}">首页</a>

            </li>
            <li>
                <a th:href="@{showRecord(pageNum = ${pageInfo.hasPrevious()} ? ${pageInfo.getNumber() } : 1)}"
                   aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            <li>
                <a th:href="@{showRecord(pageNum = ${pageInfo.hasNext()} ? ${pageInfo.getNumber()} + 2 : ${pageInfo.totalPages})}"
                   aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
            <li>
                <a th:href="@{showRecord(pageNum = ${pageInfo.totalPages})}">尾页</a>
            </li>
            <li>
                <p> 当前<span th:text="${pageInfo.getNumber()} + 1"></span>页,总<span
                        th:text="${pageInfo.totalPages}"></span>页共<span th:text="${pageInfo.totalElements}"></span>条记录
                </p>
            </li>
        </ul>
    </nav>
</div>


</body>
</html>